package cn.com.anypay.manager.payment.dto;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 支付请求数据传输对象
 *
 * 包含创建支付订单所需的所有参数
 *
 * @author AnyPay Team
 * @version 1.0
 * @since 2025-07-05
 */
public class PaymentRequestDTO {

    /**
     * 商户订单号
     */
    private String merchantOrderId;

    /**
     * 支付渠道ID
     */
    private String channelId;

    /**
     * 渠道实现类型，如 impl1, impl2, default
     */
    private String implementationType;

    /**
     * 支付产品，如 JSAPI, NATIVE, APP, H5
     */
    private String payProduct;

    /**
     * 支付金额，单位：元
     */
    private BigDecimal amount;

    /**
     * 货币类型，默认 CNY
     */
    private String currency = "CNY";

    /**
     * 商品描述
     */
    private String subject;

    /**
     * 商品详情
     */
    private String body;

    /**
     * 用户标识（如微信OpenID）
     */
    private String userId;

    /**
     * 用户IP地址
     */
    private String userIp;

    /**
     * 回调通知URL
     */
    private String notifyUrl;

    /**
     * 前端返回URL
     */
    private String returnUrl;

    /**
     * 超时时间，单位：分钟
     */
    private Integer expireMinutes;

    /**
     * 附加数据
     */
    private String attach;

    /**
     * 扩展参数
     */
    private Map<String, Object> extParams;

    public PaymentRequestDTO() {
    }

    public PaymentRequestDTO(String merchantOrderId, String channelId, String payProduct, BigDecimal amount, String subject) {
        this.merchantOrderId = merchantOrderId;
        this.channelId = channelId;
        this.payProduct = payProduct;
        this.amount = amount;
        this.subject = subject;
    }

    // Getters and Setters
    public String getMerchantOrderId() {
        return merchantOrderId;
    }

    public void setMerchantOrderId(String merchantOrderId) {
        this.merchantOrderId = merchantOrderId;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public String getImplementationType() {
        return implementationType;
    }

    public void setImplementationType(String implementationType) {
        this.implementationType = implementationType;
    }

    public String getPayProduct() {
        return payProduct;
    }

    public void setPayProduct(String payProduct) {
        this.payProduct = payProduct;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserIp() {
        return userIp;
    }

    public void setUserIp(String userIp) {
        this.userIp = userIp;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getReturnUrl() {
        return returnUrl;
    }

    public void setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
    }

    public Integer getExpireMinutes() {
        return expireMinutes;
    }

    public void setExpireMinutes(Integer expireMinutes) {
        this.expireMinutes = expireMinutes;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    public Map<String, Object> getExtParams() {
        return extParams;
    }

    public void setExtParams(Map<String, Object> extParams) {
        this.extParams = extParams;
    }

    @Override
    public String toString() {
        return "PaymentRequest{" +
                "merchantOrderId='" + merchantOrderId + '\'' +
                ", channelId='" + channelId + '\'' +
                ", implementationType='" + implementationType + '\'' +
                ", payProduct='" + payProduct + '\'' +
                ", amount=" + amount +
                ", currency='" + currency + '\'' +
                ", subject='" + subject + '\'' +
                ", body='" + body + '\'' +
                ", userId='" + userId + '\'' +
                ", userIp='" + userIp + '\'' +
                ", notifyUrl='" + notifyUrl + '\'' +
                ", returnUrl='" + returnUrl + '\'' +
                ", expireMinutes=" + expireMinutes +
                ", attach='" + attach + '\'' +
                ", extParams=" + extParams +
                '}';
    }
}